package br.com.webcrm.util;

/**
 *
 * @author Frederiko
 */

public class ViewState {
    private boolean visible;
    private boolean enable = true;    
    private boolean cmdExcluirdDisable = true;
    private boolean cmdAdicionarDisable = false;
    private boolean cmdAlterarDisable = true;
    private boolean cmdGravarDisable = true;

    public boolean isCmdAdicionarDisable() {
        return cmdAdicionarDisable;
    }

    public void setCmdAdicionarDisable(boolean cmdAdicionarDisable) {
        this.cmdAdicionarDisable = cmdAdicionarDisable;
    }

    public boolean isCmdAlterarDisable() {
        return cmdAlterarDisable;
    }

    public void setCmdAlterarDisable(boolean cmdAlterarDisable) {
        this.cmdAlterarDisable = cmdAlterarDisable;
    }

    public boolean isCmdExcluirdDisable() {
        return cmdExcluirdDisable;
    }

    public void setCmdExcluirdDisable(boolean cmdExcluirdDisable) {
        this.cmdExcluirdDisable = cmdExcluirdDisable;
    }

    public boolean isCmdGravarDisable() {
        return cmdGravarDisable;
    }

    public void setCmdGravarDisable(boolean cmdGravarDisable) {
        this.cmdGravarDisable = cmdGravarDisable;
    }
  
    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public void trataVisao(){
        setEnable(true);
        setCmdAlterarDisable(true);
        setCmdAdicionarDisable(false);
        setCmdGravarDisable(true);
        setCmdExcluirdDisable(true);
        
    }
    public void trataAlterar(){
        setEnable(false);
        setCmdAlterarDisable(true);
        setCmdAdicionarDisable(true);
        setCmdGravarDisable(false);
        setCmdExcluirdDisable(true);
        
    }

    public void trataAdicao(){
        setEnable(false);
        setCmdAlterarDisable(true);
        setCmdAdicionarDisable(true);
        setCmdGravarDisable(false);
        setCmdExcluirdDisable(true);
        
    }

    public void trataSelecao(){
        setCmdExcluirdDisable(false);
        setCmdAlterarDisable(false);
    }
    
}
